package com.itheima.exerciseTest.method20_29.method22;

import java.util.concurrent.FutureTask;

public class Demo {
    public static void main(String[] args) {
        // method1();

        // method2();

        //method3();
    }

    private static void method3() {
        MyCallable mc = new MyCallable();
        FutureTask<String> ft1 = new FutureTask<>(mc);
        FutureTask<String> ft2 = new FutureTask<>(mc);
        Thread t1 = new Thread(ft1);
        Thread t2 = new Thread(ft2);
        t1.start();
        t2.start();
    }

    private static void method2() {
        MyRubbable mr = new MyRubbable();
        Thread t1 = new Thread(mr);
        Thread t2 = new Thread(mr);
        t1.start();
        t2.start();
    }

    private static void method1() {
        MyThread mt1 = new MyThread();
        mt1.start();
        MyThread mt2 = new MyThread();
        mt2.start();
    }
}
